/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "T_CATEGORIA_ARTICULOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TCategoriaArticulos.findAll", query = "SELECT t FROM TCategoriaArticulos t"),
    @NamedQuery(name = "TCategoriaArticulos.findByNIdCategoriaArticuloPk", query = "SELECT t FROM TCategoriaArticulos t WHERE t.nIdCategoriaArticuloPk = :nIdCategoriaArticuloPk"),
    @NamedQuery(name = "TCategoriaArticulos.findByVDescripcionCategoria", query = "SELECT t FROM TCategoriaArticulos t WHERE t.vDescripcionCategoria = :vDescripcionCategoria")})
public class TCategoriaArticulos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "N_ID_CATEGORIA_ARTICULO_PK")
    private Short nIdCategoriaArticuloPk;
    @Basic(optional = false)
    @Column(name = "V_DESCRIPCION_CATEGORIA")
    private String vDescripcionCategoria;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nIdCategoriaArticuloFk")
    private List<TMarcasArticulos> tMarcasArticulosList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nIdCategoriaArticuloFk")
    private List<TSubcategoriaArticulos> tSubcategoriaArticulosList;

    public TCategoriaArticulos() {
    }

    public TCategoriaArticulos(Short nIdCategoriaArticuloPk) {
        this.nIdCategoriaArticuloPk = nIdCategoriaArticuloPk;
    }

    public TCategoriaArticulos(Short nIdCategoriaArticuloPk, String vDescripcionCategoria) {
        this.nIdCategoriaArticuloPk = nIdCategoriaArticuloPk;
        this.vDescripcionCategoria = vDescripcionCategoria;
    }

    public Short getNIdCategoriaArticuloPk() {
        return nIdCategoriaArticuloPk;
    }

    public void setNIdCategoriaArticuloPk(Short nIdCategoriaArticuloPk) {
        this.nIdCategoriaArticuloPk = nIdCategoriaArticuloPk;
    }

    public String getVDescripcionCategoria() {
        return vDescripcionCategoria;
    }

    public void setVDescripcionCategoria(String vDescripcionCategoria) {
        this.vDescripcionCategoria = vDescripcionCategoria;
    }

    @XmlTransient
    public List<TMarcasArticulos> getTMarcasArticulosList() {
        return tMarcasArticulosList;
    }

    public void setTMarcasArticulosList(List<TMarcasArticulos> tMarcasArticulosList) {
        this.tMarcasArticulosList = tMarcasArticulosList;
    }

    @XmlTransient
    public List<TSubcategoriaArticulos> getTSubcategoriaArticulosList() {
        return tSubcategoriaArticulosList;
    }

    public void setTSubcategoriaArticulosList(List<TSubcategoriaArticulos> tSubcategoriaArticulosList) {
        this.tSubcategoriaArticulosList = tSubcategoriaArticulosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nIdCategoriaArticuloPk != null ? nIdCategoriaArticuloPk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TCategoriaArticulos)) {
            return false;
        }
        TCategoriaArticulos other = (TCategoriaArticulos) object;
        if ((this.nIdCategoriaArticuloPk == null && other.nIdCategoriaArticuloPk != null) || (this.nIdCategoriaArticuloPk != null && !this.nIdCategoriaArticuloPk.equals(other.nIdCategoriaArticuloPk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entityBeans.TCategoriaArticulos[ nIdCategoriaArticuloPk=" + nIdCategoriaArticuloPk + " ]";
    }
    
}
